package com.dongl.jwtdemo.modules.sevice;

import com.dongl.jwtdemo.modules.DataSource;
import com.dongl.jwtdemo.modules.entity.UserBean;
import org.springframework.stereotype.Component;

@Component
public class UserService {

    public UserBean getUser(String username) {
        // 没有此用户直接返回null
        if (! DataSource.getData().containsKey(username))
            return null;

        UserBean user = DataSource.getData().get(username);

        return user;
    }
}
